package com.lims.landInfo.model;

import javax.persistence.*;

import org.hibernate.annotations.GenericGenerator;

import org.apache.commons.lang.builder.EqualsBuilder;
import org.apache.commons.lang.builder.HashCodeBuilder;
import org.apache.commons.lang.builder.ToStringBuilder;
import org.apache.commons.lang.builder.ToStringStyle;

import javacommon.base.*;

/**
 * @author zzh
 * @version 1.0
 * @since 1.0
 */@Entity
@Table(name = "LIMS_LandFile")
public class LandFile extends BaseEntity implements java.io.Serializable{
	private static final long serialVersionUID = 5454155825314635342L;
	//date formats
	
	//可以直接使用: @Length(max=50,message="用户名长度不能大于50")显示错误消息
	//columns START
    /**
     * objid       db_column: OBJID 
     */ 	
	private java.lang.String objid;
    /**
     * sno       db_column: sno 
     */ 	
	private java.lang.Integer sno;
    /**
     * name       db_column: name 
     */ 	
	private java.lang.String name;
    /**
     * filePath       db_column: filePath 
     */ 	
	private java.lang.String filePath;
    /**
     * downFilePath       db_column: downFilePath 
     */ 	
	private java.lang.String downFilePath;
    /**
     * fileType       db_column: fileType 
     */ 	
	private java.lang.Integer fileType;
    /**
     * describe       db_column: describe 
     */ 	
	private java.lang.String describe;
    /**
     * landId       db_column: landId 
     */ 	
	private java.lang.String landId;
	//columns END

	public LandFile(){
	}

	public LandFile(
		java.lang.String objid
	){
		this.objid = objid;
	}

	public void setObjid(java.lang.String value) {
		this.objid = value;
	}
	
	@Id @GeneratedValue(generator="custom-id")
	@GenericGenerator(name="custom-id", strategy = "uuid")
	@Column(name = "OBJID", unique = true, nullable = false, insertable = true, updatable = true, length = 32)
	public java.lang.String getObjid() {
		return this.objid;
	}
	
	@Column(name = "sno", unique = false, nullable = true, insertable = true, updatable = true, length = 10)
	public java.lang.Integer getSno() {
		return this.sno;
	}
	
	public void setSno(java.lang.Integer value) {
		this.sno = value;
	}
	
	@Column(name = "name", unique = false, nullable = true, insertable = true, updatable = true, length = 150)
	public java.lang.String getName() {
		return this.name;
	}
	
	public void setName(java.lang.String value) {
		this.name = value;
	}
	
	@Column(name = "filePath", unique = false, nullable = true, insertable = true, updatable = true, length = 255)
	public java.lang.String getFilePath() {
		return this.filePath;
	}
	
	public void setFilePath(java.lang.String value) {
		this.filePath = value;
	}
	
	@Column(name = "downFilePath", unique = false, nullable = true, insertable = true, updatable = true, length = 255)
	public java.lang.String getDownFilePath() {
		return this.downFilePath;
	}
	
	public void setDownFilePath(java.lang.String value) {
		this.downFilePath = value;
	}
	
	@Column(name = "fileType", unique = false, nullable = true, insertable = true, updatable = true, length = 10)
	public java.lang.Integer getFileType() {
		return this.fileType;
	}
	
	public void setFileType(java.lang.Integer value) {
		this.fileType = value;
	}
	
	@Column(name = "describe", unique = false, nullable = true, insertable = true, updatable = true, length = 255)
	public java.lang.String getDescribe() {
		return this.describe;
	}
	
	public void setDescribe(java.lang.String value) {
		this.describe = value;
	}
	
	@Column(name = "landId", unique = false, nullable = true, insertable = false, updatable = false, length = 32)
	public java.lang.String getLandId() {
		return this.landId;
	}
	
	public void setLandId(java.lang.String value) {
		this.landId = value;
	}
	
	private Land land;
	
	@ManyToOne
	@JoinColumn(name="landId")
	public Land getLand() {
		return land;
	}

	public void setLand(Land land) {
		this.land = land;
	}

	public String toString() {
		return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
			.append("Objid",getObjid())
			.append("Sno",getSno())
			.append("Name",getName())
			.append("FilePath",getFilePath())
			.append("DownFilePath",getDownFilePath())
			.append("FileType",getFileType())
			.append("Describe",getDescribe())
			.append("LandId",getLandId())
			.toString();
	}
	
	public int hashCode() {
		return new HashCodeBuilder()
			.append(getObjid())
			.toHashCode();
	}
	
	public boolean equals(Object obj) {
		if(obj instanceof LandFile == false) return false;
		if(this == obj) return true;
		LandFile other = (LandFile)obj;
		return new EqualsBuilder()
			.append(getObjid(),other.getObjid())
			.isEquals();
	}
}

